package boxing;

//不使用泛型的写法
class Book{

}

class Student{

}

class MyArray{
    private Object[] data;
    public Object get(int index){
        return data[index];
    }
    public void set(int index,Object value){
        data[index] = value;
    }
}
public class Test3 {
    public static void main(String[] args) {
        MyArray array = new MyArray();
        array.set(0,new Book());
        array.set(1,new Student());
        array.set(2,new String("hello"));

        Object obj = array.get(0);
        //还需要进行转换,但是有时候会转错,不靠谱
        Book book = (Book) obj;
    }
}
